package com.zhoukun.cloud.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author zhoukun 86547462@qq.com
 * @version 1.0
 * @date 2020/10/28 19:09
 */
@Configuration
public class GatewayConfig {

    @Bean
    public RouteLocator routes(RouteLocatorBuilder builder) {
        return builder.routes()
                .route("wangyiyunApi-route", r -> r.path("/guonei")
                        .uri("http://news.baidu.com")

                ).route("wangyiyunApi-route", r -> r.path("/guoji")
                        .uri("http://news.baidu.com")

                    ).build();
    }
}
